import path from 'path'
import ts from 'rollup-plugin-typescript2'
// 用于生成.d.ts文件
import { dts } from 'rollup-plugin-dts'
export default [
    {
        input: "./src/core/index.ts",
        // 导出3种模式
        output: [
            {
                file: path.resolve(__dirname, './dist/index.ems.js'),
                format: 'es'
            },
            {
                file: path.resolve(__dirname, './dist/index.cjs.js'),
                format: 'cjs'
            },
            {
                file: path.resolve(__dirname, './dist/index.js'),
                format: 'umd',
                name: 'tracker'
            }
        ],
        plugins: [
            // 会去读tsconfig.json
            ts()
        ]
    },
    {
        input: "./src/core/index.ts",
        output: [
            {
                file: path.resolve(__dirname, './dist/index.d.ts'),
                format: 'es'
            }
        ],
        plugins: [
            // 用于生成声明文件
            dts()
        ]
    }
]